<?php

class Model_Cnotice {
	
	protected static $_dateDiff = 5;
	
	public static function css($dateToCheck){
		
		$dateToday = Model_DatetimeHelper::dateToday();
		
		$css = '';
		if(Model_DatetimeHelper::dateDiff($dateToday, $dateToCheck) <= self::$_dateDiff){
		
		$css = '<style>
		.black_overlay{
			display: none;
			position: absolute;
			top: 0%;
			left: 0%;
			width: 100%;
			height: 100%;
			background-color: black;
			z-index:1001;
			-moz-opacity: 0.8;
			opacity:.80;
			filter: alpha(opacity=80);
		}
		.white_content {
			display: none;
			position: absolute;
			top: 15%;
			left: 15%;
			width:auto;
			height:auto;
			padding: 16px;
			border: 16px solid orange;
			background-color: white;
			z-index:1002;
			overflow: auto;
		}
		.div_right_top {
		width:120px;
		float:right;
		position:fixed;
		right:0px;
		top:0px;
		z-index:20;
}
	</style>';
		}
		return $css;
		
	}
	
	public static function content($dateToCheck,$image){
		
		$content = '';
		$dateToday = Model_DatetimeHelper::dateToday();
		if(Model_DatetimeHelper::dateDiff($dateToday, $dateToCheck) <= self::$_dateDiff){
			
			$content = "<div class=\"div_right_top\"><a href = \"javascript:void(0)\" onclick = \"document.getElementById('light').style.display='block';document.getElementById('fade').style.display='block'\"><img src=\"/css/newchangeicon.jpg\" border = \"0\" ></a></div>
		<div id=\"light\" class=\"white_content\"><a href = \"javascript:void(0)\" onclick = \"document.getElementById('light').style.display='none';document.getElementById('fade').style.display='none'\">Close</a><br /><img src =\"/changeimage/{$image}\" border = \"0\"> </div>
		
		<div id=\"fade\" class=\"black_overlay\"></div>";
			
		}
		
		return $content;
	}

}

?>